package com.sskj.mqtt.many;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Like
 * @Date: 2025/3/3 15:40
 * @Description:  Spring上下文工具配置
 */
@Slf4j
@Configuration
@EnableConfigurationProperties
public class CoreConfiguration {

    /**
     * Spring上下文工具配置
     *
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(SpringContextHolder.class)
    public SpringContextHolder springContextHolder() {
        SpringContextHolder holder = new SpringContextHolder();
        log.info("SpringContextHolder >>>>>> [{}]", holder);
        return holder;
    }
}
